import Vue from 'vue';
import App from './App';
import router from "./router";
import store from './store';
import '../assets/less/index.less';
import './permission'
import Vant from 'vant';
import { Toast } from 'vant';
import 'vant/lib/index.css';
Vue.use(Vant);
Vue.prototype.$Toast = Toast;
store.dispatch('initAllState');
// 开发调试
if (process.env.NODE_ENV === 'development') {
    Vue.config.devtools = true;
} else {
    Vue.config.devtools = false;
}
router.beforeEach((to, from, next) => {
    /*/!* 判断条件待修改 *!/
    if (~to.path.indexOf('/login') > 0) {
        vueInstance.$sessionStorage.setMenuIndexActive('');
        vueInstance.$sessionStorage.setTabActive('');
    }*/
    if (to.meta.title) {
        document.title = to.meta.title;
    }
    next();
});

new Vue({
    el: "#root",
    router,
    store,
    render: (h) => h(App)
});
